package com.peng.dao.impl;

import com.peng.dao.user_typeDao;
import com.peng.entity.user_type;
import com.peng.util.BaseDao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by 欧阳欣鹏 on 2018/8/6.
 */
public class user_typeDaoImpl implements user_typeDao
{

    @Override
        public String li() {
        String i = "";
            List<user_type> li=new ArrayList<user_type>();
            String sql="select utname from user_type where utid=5";
        Connection con=null;
        PreparedStatement st=null;
        ResultSet rs=null;
        try {
            con= BaseDao.getConnection();
            st=con.prepareStatement(sql);
            rs=st.executeQuery();
            while (rs.next()) {
               i = rs.getString("utname");
            }
        } catch (Exception e) {
            // TODO: handle exception
        }finally{
            BaseDao.closeConnection(con, st, rs);
        }
        return i;
    }
}
